//
//  MenuZhuanTiDetailViewController.m
//  Products_B
//
//  Created by lanou on 16/6/5.
//  Copyright © 2016年 朋学友. All rights reserved.
//
//  http://api.izhangchu.com/
// methodName=AppShare&shareID=197&shareModule=subject&token=&user_id=&version=4.4
#import "MenuZhuanTiDetailViewController.h"

@interface MenuZhuanTiDetailViewController ()
@property(nonatomic,strong)NSMutableDictionary *parDic;
@property (nonatomic, strong)UIWebView *webView ;
@end

@implementation MenuZhuanTiDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
    
    self.parDic = @{@"methodName":@"AppShare",@"shareID":self.shareID,@"shareModule":@"subject",@"token":@"",@"user_id":@"",@"version":@"4.4"}.mutableCopy;
    _webView =[[UIWebView alloc]initWithFrame:self.view.frame];

    
    [self.view addSubview:_webView];
    
    [self requestData];
}
- (void)requestData{
    [RequestManager requestWithUrl:@"http://api.izhangchu.com/" requestType:(RequestTypePOST) parDic:self.parDic finish:^(NSData *data) {
        NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
        
        [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:jsonDic[@"data"][@"link"]]]];
        NSLog(@"%@",jsonDic[@"data"][@"link"]);//http://m.izhangchu.com/topic_view/index.html?&topic_id=197
    } error:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
